#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int cmp(int* e1, int*  e2)
{
	if (*e1 - *e2> 0)
	{
		return 1;
	}
	else if(*e1 <*e2)
	{
		return -1;
	}
	else
	{
		return 0;
	}
}
void FindSingle(int* arr, int se)
{
	1.ȫԪ
	int ret = 0;
	int pos = 0;
	int x = 0;
	int y = 0;
	for (int i = 0; i < se; i++)
	{
		ret ^=arr[i];
	}

	for (int i = 0; i < 32; i++)
	{
		if (((ret >> i) & 1) == 1)
		{
			 pos = i;
			break;
		}
	}
	//2.
	for (int i = 0; i < se; i++)
	{
		if (((arr[i] >> pos)&1)==1)
		{
			x ^= arr[i];
		}
		else
		{
			y ^= arr[i];
		}
	}
	printf("%d,%d", x, y);
	qsort(arr, se, sizeof(int), cmp);
	for (int i = 0; i < se; i++)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
	for (int i = 0; i < se-1; )
	{
		if (arr[i] == arr[i + 1])
		{
			i = i + 2;
		}
		else
		{
			printf("%d", arr[i]);
			i++;
		}
	}
	if (arr[se - 1] != arr[se - 2])
	{
		printf("%d", arr[se - 1]);
	}

}
int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,1,2,3,4,5,6,7,8,10,12 };
	int se = sizeof(arr) / sizeof(int);
	FindSingle(arr, se);
	return 0;
}